package jmine.tec.web.front.dispatcher.request;

import jmine.tec.web.front.domain.BackOfficeRequest;
import bancosys.tec.security.SecurityService;

/**
 * Fills a back office command user
 * 
 * @author lundberg
 * @param <F> form type
 */
public class BackOfficeRequestUserFiller<F> implements BackOfficeRequestFiller<F> {

    private final SecurityService securityService;

    /**
     * Constructor
     * 
     * @param securityService securityService
     */
    public BackOfficeRequestUserFiller(SecurityService securityService) {
        this.securityService = securityService;
    }

    /**
     * {@inheritDoc}
     */
    public void fill(BackOfficeRequest request, F form) {
        request.setRequestingUser(this.securityService.getCurrentUser());
    }
}
